<extend name="Public/base"/>

<block name="body">
	<div class="main-title">
		<h2>{$info['id']?'编辑':'新增'}Agent</h2>
	</div>
	<form action="{:U()}" method="post" class="form-horizontal">
		<div class="form-item">
			<label class="item-label">名称<span class="check-tips">（Agent名称，不能重复）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="name" value="{$info.name|default=''}">
			</div>
		</div>

		<div class="form-item">
			<label class="item-label">分组<span class="check-tips">（Agent所在的组名）</span></label>
			<div class="controls">
				<select name="gid">
					<option value="0">--点此选择分组--</option>
					<volist name="group" id="gid">
						<option value="{$key}">{$gid}</option>
					</volist>
				</select>
			</div>
		</div>

		<div class="form-item">
			<label class="item-label">IP<span class="check-tips">（Agent IP）</span></label>
			<div class="controls">
				<input type="text" class="text input-large" name="ip" value="{$info.ip|default=''}">
			</div>
		</div>

		<div class="form-item">
			<label class="item-label">端口<span class="check-tips">（Agent Port）</span></label>
			<div class="controls">
				<input type="number" class="text input-small" name="port" value="{$info.port|default=9501}">
			</div>
		</div>

		<div class="form-item">
			<input type="hidden" name="id" value="{$info.id|default=''}">
			<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
			<button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
		</div>
	</form>
</block>

<block name="script">
	<script type="text/javascript">
		Think.setValue("gid", {$info.gid|default=0});
		//导航高亮
		highlight_subnav('{:U('Task/agent')}');
	</script>
</block>
